/* 全局样式 */
body {
    font-family: "Microsoft YaHei", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* 确保所有菜单和列表水平显示 */
.navbar-nav,
ul, 
.list-group,
.list-inline,
.nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
    list-style: none !important;
}

.navbar-nav .nav-item,
ul li, 
.list-group-item,
.list-inline-item,
.nav-item {
    display: inline-block !important;
    margin-right: 10px !important;
    position: relative !important;
}

/* 美化导航菜单 */
.navbar-nav .nav-link,
ul li a, 
.nav-item .nav-link {
    color: inherit;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
ul li a:hover, 
.nav-item .nav-link:hover {
    background-color: rgba(0,0,0,0.05);
}

/* 水平菜单列表美化 */
.system-menu {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 20px 0 !important;
    border-radius: 6px;
    padding: 12px !important;
}

.system-menu li {
    display: inline-block !important;
    margin-right: 15px !important;
}

.system-menu li:last-child {
    margin-right: 0 !important;
}

.system-menu li a {
    color: #2c3e50;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    display: block;
    font-weight: 500;
    transition: all 0.3s ease;
}

.system-menu li a:hover {
    background-color: rgba(26,115,232,0.1);
    color: #1a73e8;
}

.system-menu li.active a {
    background-color: #1a73e8;
    color: white;
}

/* 用户信息和登出链接样式 */
.user-info-wrapper {
    color: #e0e6ec;
    font-weight: 500;
    height: 100%;
    display: flex;
    align-items: center;
}

.admin-info {
    display: flex;
    align-items: center;
    padding: 0 10px;
    height: 100%;
}

.admin-info i {
    margin-right: 6px;
    color: #ffcc66;
}

.logout-link a, .login-link a {
    color: #e0e6ec !important;
    transition: all 0.3s ease;
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-left: 15px !important;
    padding-right: 0 !important;
    height: 100%;
    display: flex;
    align-items: center;
}

.logout-link a:hover, .login-link a:hover {
    color: #ffcc66 !important;
}

.logout-link a i, .login-link a i {
    transition: all 0.3s ease;
}

.logout-link a:hover i, .login-link a:hover i {
    transform: translateX(3px);
}

/* 菜单颜色修复 */
.navbar-dark {
    background: linear-gradient(to right, #1a2a3a, #324759) !important;
}

.navbar-dark .navbar-nav .nav-link {
    color: #e0e6ec !important;
    font-weight: 500;
    position: relative;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #ffcc66 !important;
}

.navbar-dark .navbar-nav .nav-item.active .nav-link {
    color: #ffcc66 !important;
    font-weight: 600;
}

.navbar-dark .navbar-nav .nav-item.active .nav-link:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: #ffcc66;
    border-radius: 3px;
}

.navbar-dark .navbar-brand {
    color: #ffcc66 !important;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

/* 添加下拉菜单样式 */
.navbar-dark .dropdown-menu {
    background-color: #253649;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 8px 0;
    margin-top: 10px;
}

.navbar-dark .dropdown-item {
    color: #e0e6ec;
    padding: 8px 15px;
    transition: all 0.2s ease;
}

.navbar-dark .dropdown-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: #ffcc66;
}

.dropdown-toggle::after {
    margin-left: 8px;
    vertical-align: middle;
}

/* 修复表单布局，确保标签和输入框在同一行 */
.form-row {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 15px !important;
}

.form-label {
    min-width: 100px !important;
    margin-right: 10px !important;
    margin-bottom: 0 !important;
    text-align: right !important;
    font-weight: 500 !important;
}

.form-input {
    flex: 1 !important;
}

/* 表单组中的输入框组*/
.input-group-text {
    background-color: #f8f9fa !important;
    border-right: none !important;
}

.form-control {
    border-left: none !important;
}

/* 美化输入控件和图标的对齐 */
.input-with-icon {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 15px !important;
}

.input-with-icon .icon {
    margin-right: 10px !important;
    width: 25px !important;
    text-align: center !important;
    color: #495057 !important;
}

.input-with-icon .form-control {
    border-radius: 4px !important;
    border: 1px solid #ced4da !important;
}

/* 确保所有表单元素在同一行 */
.form-inline {
    display: flex !important;
    align-items: center !important;
}

.form-inline .form-control {
    margin-right: 10px !important;
}

/* 美化页面标题和描述 */
.page-header {
    margin-bottom: 20px !important;
}

.page-title {
    font-size: 24px !important;
    font-weight: 600 !important;
    color: #343a40 !important;
    margin-bottom: 5px !important;
}

.page-description {
    color: #6c757d !important;
    font-size: 16px !important;
}

/* 美化卡片标题 */
.card-header {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125) !important;
}

.card-header h5 {
    margin-bottom: 0 !important;
    font-weight: 600 !important;
}

/* 确保基本信息表单项在同一行显示 */
.basic-info-form label,
.basic-info-form .field-icon,
.basic-info-form .field-input {
    display: inline-block !important;
    vertical-align: middle !important;
}

.basic-info-form label {
    min-width: 100px !important;
    margin-right: 10px !important;
    text-align: right !important;
}

.basic-info-form .field-icon {
    width: 30px !important;
    text-align: center !important;
    margin-right: 5px !important;
}

.basic-info-form .field-input {
    display: inline-block !important;
}

/* 基本信息表单 - 特定修复 */
.info-form {
    margin-bottom: 20px;
}

.info-form .form-group {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 15px !important;
}

.info-form label {
    min-width: 120px !important;
    text-align: right !important;
    margin-right: 15px !important;
    margin-bottom: 0 !important;
    font-weight: 500 !important;
    color: #495057 !important;
}

.info-form .field-content {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
}

/* 特殊针对新增部署信息页面 */
.field-row {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 15px !important;
}

.field-row label {
    min-width: 120px !important;
    margin-right: 10px !important;
    text-align: right !important;
    margin-bottom: 0 !important;
    font-weight: 500 !important;
}

.field-row .icon {
    margin-right: 10px !important;
    width: 20px !important;
    text-align: center !important;
    color: #6c757d !important;
}

.field-row input,
.field-row select,
.field-row textarea {
    flex: 1 !important;
}

/* 对话框表单美化 */
.modal .form-group {
    display: flex !important;
    align-items: flex-start !important;
    margin-bottom: 15px !important;
}

.modal .control-label {
    min-width: 100px !important;
    margin-right: 15px !important;
    margin-top: 7px !important;
    text-align: right !important;
}

.modal .form-control {
    flex: 1 !important;
}

/* 表单元素水平排列 - 特别针对截图中的表单布局 */
.horizontal-form-group {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 10px !important;
}

.horizontal-form-group > * {
    margin-right: 10px !important;
}

.horizontal-form-group > *:last-child {
    margin-right: 0 !important;
}

.horizontal-form-group label {
    min-width: 80px !important;
    text-align: right !important;
    margin-bottom: 0 !important;
    font-weight: 500 !important;
}

.horizontal-form-group .form-control {
    flex: 1 !important;
}

/* 针对截图中的部署信息表单 */
.deployment-form label,
.deployment-form .field-icon,
.deployment-form .form-control {
    display: inline-block !important;
    vertical-align: middle !important;
}

.deployment-form label {
    min-width: 80px !important;
    text-align: right !important;
    margin-right: 10px !important;
    margin-bottom: 0 !important;
    font-weight: 500 !important;
    flex-shrink: 0 !important;
}

.deployment-form .field-icon {
    width: 25px !important;
    text-align: center !important;
    margin-right: 5px !important;
    color: #6c757d !important;
    flex-shrink: 0 !important;
}

.deployment-form .form-control {
    flex: 1 !important;
    border-radius: 4px !important;
    border: 1px solid #ced4da !important;
}

/* 确保卡片内所有表单组在水平方向对齐 */
.card .form-group {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 1rem !important;
}

.card .form-group label {
    width: 120px !important;
    text-align: right !important;
    margin-right: 15px !important;
    margin-bottom: 0 !important;
}

.card .form-group .form-control,
.card .form-group .input-group {
    flex: 1 !important;
}

/* 修复下拉菜单样式 */
select.form-control {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    padding-right: 25px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23343a40' d='M0 0l4 4 4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 8px 8px !important;
}

/* 美化表单描述文本 */
.form-text {
    font-size: 0.85rem !important;
    color: #6c757d !important;
    margin-top: 5px !important;
}

/* 单个输入框组的样式 */
.single-input-group {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 1rem !important;
}

.single-input-group label {
    width: 90px !important;
    text-align: right !important;
    margin-right: 10px !important;
    margin-bottom: 0 !important;
    color: #495057 !important;
    font-weight: 500 !important;
}

.single-input-group .icon {
    width: 30px !important;
    text-align: center !important;
    color: #6c757d !important;
    margin-right: 5px !important;
}

.single-input-group input, 
.single-input-group select {
    flex: 1 !important;
    border-radius: 4px !important;
    border: 1px solid #ced4da !important;
}

/* 调整所有单行输入框宽度 */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
select:not([multiple]) {
    max-width: 320px !important;
    width: 100% !important;
}

/* 对于特殊字段，如代码、密钥等可能需要更宽的输入框 */
input.wide-input,
.wide-input input {
    max-width: 420px !important;
}

/* 文本区域保持较宽以便于内容编辑 */
textarea {
    max-width: 500px !important;
    width: 100% !important;
}

/* 对于登录页面的输入框控制 */
.login-form input,
.login-container .input-group {
    max-width: 100% !important;
}

/* 在小屏幕上允许输入框占满宽度 */
@media (max-width: 576px) {
    input[type="text"],
    input[type="email"],
    input[type="url"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="search"],
    select:not([multiple]),
    textarea {
        max-width: 100% !important;
    }
}

/* 彻底解决页面抖动问题 */
html {
    overflow-y: scroll !important;
    scrollbar-width: thin;
    /* 固定宽度以防止滚动条显示/隐藏导致布局变化 */
    width: calc(100vw - 17px);
    max-width: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

/* 美化滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 模态窗口样式修复 */
.modal {
    padding-right: 0 !important;
}

.modal-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

/* 确保表单输入框和标签在同一行 */
.form-group {
    align-items: center !important;
    display: flex !important;
    flex-wrap: wrap !important;
}

.field-row {
    align-items: center !important;
    display: flex !important;
    flex-wrap: wrap !important;
}

/* 防止模态框和页面跳动 */
.modal-backdrop {
    width: 100% !important;
    height: 100% !important;
} 